﻿@{
    ViewBag.Title = "元素表单页";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<style>
    .tipSpan{
        color:red;padding-right:8px;
    }
</style>
<form id="form1">

    <input id="Id" name="Id"  class="form-control" type="hidden" />
    <div class="panel panel-default">
        <div class="panel-body" style="padding-top: 20px;">
            <table class="form">
                <tr>
                    <th class="formTitle">上级元素：</th>
                    <td class="formValue">

                        <select id="yssjid" name="yssjid" class="form-control">
                            @*<option value="29D0F655-CE99-4101-8C2F-6AA19A8AAE6C" selected>病人基本信息</option>*@
                        </select>
                    </td>
                    <th class="formTitle"></th>
                    <td class="formValue">
                    </td>
                </tr>
                <tr>
                    <th class="formTitle"><span class="tipSpan">*</span>元素名称：</th>
                    <td class="formValue">
                        <input id="ysmc" name="ysmc" type="text" class="form-control required" />
                    </td>
                    <th class="formTitle"></th>
                    <td class="formValue">                        
                    </td>
                </tr>

                <tr>
                    <th class="formTitle"><span class="tipSpan">*</span>背景文字：</th>
                    <td class="formValue">
                        <input id="BackgroundText" name="BackgroundText" type="text" class="form-control required" />
                    </td>
                    <th class="formTitle">备注：</th>
                    <td class="formValue">
                        <input id="Description" name="Description" type="text" class="form-control" />
                    </td>
                </tr>

                <tr>
                    <th class="formTitle"><span class="tipSpan">*</span>数据源：</th>
                    <td class="formValue">
                        <input id="DataSource" name="DataSource" type="text" class="form-control required" />
                    </td>
                    <th class="formTitle"><span class="tipSpan">*</span>元素标识：</th>
                    <td class="formValue">
                        <input id="yscode" name="yscode" type="text" class="form-control required" />
                    </td>
                </tr>

                <tr>
                    <th class="formTitle"><span class="tipSpan">*</span>是否自动更新：</th>
                    <td class="formValue">
                        <select id="AutoUpdate" name="AutoUpdate" class="form-control required">
                            <option value="true" selected>是</option>
                            <option value="false">否</option>
                        </select>
                        @*<input id="AutoUpdate" name="AutoUpdate" type="text" class="form-control required" />*@
                    </td>
                    <th class="formTitle"><span class="tipSpan">*</span>是否只读：</th>
                    <td class="formValue">
                        <select id="Readonly" name="Readonly" class="form-control required">
                            <option value="true" selected>是</option>
                            <option value="false">否</option>
                        </select>
                        @*<input id="Readonly" name="Readonly" type="text" class="form-control required" />*@
                    </td>
                </tr>



                @*<tr>
                    <th class="formTitle"><span class="tipSpan">*</span>是否下拉：</th>
                    <td class="formValue">
                        <input id="ListSource" name="ListSource" type="text" class="form-control required" value="0" />
                    </td>
                    <th class="formTitle">元素值：</th>
                    <td class="formValue">
                        <input id="Value" name="Value" type="text" class="form-control" />
                    </td>
                </tr>*@
                <tr>
                    <th class="formTitle">允许编辑：</th>
                    <td class="formValue">
                        <select id="UserEditable" name="UserEditable" class="form-control">
                            <option value="true" selected>是</option>
                            <option value="false">否</option>
                        </select>
                        @*<input id="UserEditable" name="UserEditable" type="text" class="form-control" />*@
                    </td>
                    <th class="formTitle">EditStyle：</th>
                    <td class="formValue">
                        <input id="EditStyle" name="EditStyle" type="text" class="form-control" />
                    </td>
                </tr>

                <tr>
                    <th class="formTitle">Style：</th>
                    <td class="formValue">
                        <input id="Style" name="Style" type="text" class="form-control" />
                    </td>
                    <th class="formTitle"></th>
                    <td class="formValue">
                        
                    </td>
                </tr>
                <tr>
                    <th class="formTitle"><span class="tipSpan">*</span>元素类型：</th>
                    <td class="formValue">
                        <select id="TypeName" name="TypeName" class="form-control required">
                            <option value="System.String" selected>字符串（String）</option>
                            <option value="System.Text">文本（text）</option>
                            @*<option value="System.Boolean">布尔</option>*@
                            <option value="System.Numeric">数字</option>
                            <option value="System.DateTime" >时间</option>
                            @*<option value="System.Date" >日期</option>*@
                        </select>
                        @*<input id="TypeName" name="TypeName" type="text" class="form-control required"  />*@
                    </td>
                    <th class="formTitle">格式：</th>
                    <td class="formValue">
                        <input id="Format" name="Format" type="text" class="form-control" />
                    </td>
                </tr>
            </table>
            <div class="btn-group" style="float:right;margin-top:50px">
                <a class="btn btn-primary" onclick="btn_edit()" id="tijiao">新增</a>
            </div>
        </div>
        </div>
</form>
<script>
    $("#yssjid").bindSelect({
        url: "/MedicalRecordManage/Blys/GetDataSourceList",
        id: "Id",
        text:"ysmc"
    });
    $("#TypeName").change(function () {
        if ($("#TypeName").val() == "System.DateTime") {
            $("#Format").val("yyyy-MM-dd HH:mi:ss");
            $("#Style").val("DateTime");
            $("#EditStyle").val("DateTime");
        }
        else if ($("#TypeName").val() == "System.Numeric") {
            $("#Format").val("");
            $("#Style").val("Numeric");
            $("#EditStyle").val("Numeric");
        }
        else {
            $("#Format").val("");
            $("#Style").val("");
            $("#EditStyle").val("");
        }

    });


</script>

